<template>
    <div>
      <el-card class="present-card">
        <div style="height: 60px;display: flex;">
            <h3 style="line-height: 10px; ">APK信息</h3>
        </div>
        <el-descriptions :data="APKData" :column="2"
        :label-style="LS">
          <el-descriptions-item label="权限">{{ APKData.permissions }}</el-descriptions-item>
          <el-descriptions-item label="主活动">{{ APKData.activities }}</el-descriptions-item>
          <el-descriptions-item label="源代码">{{ APKData.source_code }}</el-descriptions-item>
          <el-descriptions-item label="包名">{{ APKData.package_name }}</el-descriptions-item>
          <el-descriptions-item label="文件名称">{{ APKData.app_name }}</el-descriptions-item>
          <el-descriptions-item label="图标路径">{{ APKData.app_icon_path }}</el-descriptions-item>
          <el-descriptions-item label="文件图标">{{ APKData.app_icon }}</el-descriptions-item>
          <el-descriptions-item label="版本代码">{{ APKData.android_version_code }}</el-descriptions-item>
          <el-descriptions-item label="版本名称">{{ APKData.android_version_name }}</el-descriptions-item>
      </el-descriptions>
        
        </el-card>
        <br>
    </div>
  </template>
    
    <script>
    export default {
      data() {
        return {
          APKData: [],  
          baseURL: "http://localhost:8000/",
          LS:{color:'#000'},
          ID:[],
        }
      },
    
      mounted() {
        this.savedata();
        this.getMessages();
      },
    
      methods: {
        savedata() {
          var item = localStorage.getItem("packagename");
          if(item == undefined){
            this.ID = "";
          } else {
            var parse = JSON.parse(item);
            this.ID = parse["AndroidManifest_id"];
          }
        },
        getMessages:function(){
          //记录this的地址
          let that = this
          //使用Axios实现Ajax请求
          that.axios.get(that.baseURL+"apk/android_manifest/"+that.ID+"/")
          .then(function(res){
            //请求成功后执行的函数
            that.APKData = res.data;
          })
          .catch(function(err){
            //请求失败后执行的函数
            console.log(err)
          })
        },
      }
    
    }
    </script>
    
    <style>
    
    </style>
  